ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Swift Next

by Swift-Next ST4

Swift syntax package in async/await era, with extra features, for Sublime Text.

Details

Installs

  • Total 2K
  • Win 219
  • Mac 2K
  • Linux 146
Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14
Windows 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 1 1 0 1 0 0 0 0 0 0
Mac 2 2 2 3 0 1 1 2 1 0 1 1 2 0 2 3 4 0 0 1 1 2 2 2 1 2 3 1 1 3 5 2 2 1 5 1 3 0 3 3 1 4 2 3 2 1
Linux 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Swift Next

Modern Swift syntax for Sublime Text 4

This fork maintains the Swift Next syntax package for modern Swift, targeting Swift 6.4 / 6.4.1. The original grammar and Xcode-style symbol-list integration were created by @aerobounce; this fork builds on that work and the Swift-Next community fork.

Features

  • Swift 5.7–6.4 syntax additions: macro declarations and expansions, parameter packs, primary associated types, package access, ownership modifiers, noncopyable and nonescapable conformances, typed throws, sending, and isolation options.
  • Swift 6.4 module selectors (Module::name), optional some / any types, borrow / mutate accessors, and modern built-in attributes including @diagnose.
  • Bare and extended regex literals, character classes, escapes, quantifiers, and multiline extended patterns.
  • Raw strings with matching hash delimiters and interpolation, without treating string contents as comments.
  • Modern library symbols including Task, clocks, Regex, InlineArray, spans, UniqueArray, UniqueBox, Ref, MutableRef, and Iterable.
  • Documentation comments, MARK: / TODO: / FIXME:, and Xcode-style symbol lists.

This is a syntax-highlighting package, not a Swift compiler or language server. Standard-library highlighting is name-based; it does not resolve shadowed names. Existing historical symbol lists are retained for compatibility. Language features that require compiler flags still require those flags in your toolchain.

Compatibility

  • Sublime Text 4 (syntax format version 2).
  • .swift and .swiftinterface files.
  • Latest language target checked against the Swift 6.4 release announcement and Swift 6.4.1 release notes.
  • Swift 5.6-era highlighting is retained. Deprecated syntax is not the focus of ongoing maintenance.

See CHANGELOG.md for changes and tests/README.md for verification instructions.

Install

Package Control

The community package is named Swift Next. Package Control installs the published community package; it does not automatically include unmerged changes from this personal fork. Use manual installation below to use this fork.

This fork

  1. Open Preferences → Browse Packages… in Sublime Text.
  2. Clone or copy this repository into a directory named Swift Next directly inside Packages (alongside User, not inside it).
  3. Avoid loading another Swift Next copy at the same time. Disable/remove the Package Control copy if replacing it with this checkout.
  4. Select View → Syntax → Swift for Swift files. Reopen the file if its previous syntax assignment was cached.

Build and run

The build system uses the swift executable from your environment. It does not install a toolchain or force a language mode.

  • Swift runs the current file; paths containing spaces are passed as one argument.
  • Package: Build / Test / Resolve / Update / Clean run SwiftPM in the project folder. Open the package root as a Sublime project folder first.

Development

Editing Environment

Validation

Run ruby utils/check_syntax.rb from the repository root for YAML, context-reference, meta-pattern ordering, and regex compilation checks. Ruby's regex engine differs from Sublime's, so this is a preliminary check; native scope assertions remain the authoritative check. See tests/README.md to run them in Sublime Text. GitHub Actions runs native tests against stable and development Sublime builds.

Tips

Minimize multiple words into a regex pattern

$ grex --no-anchors --capture-groups ...

References

If you are to create a syntax definition file for the first time without deep regex background like me, here's everything you need.

Sublime Text

Regular Expression

Swift

Other Fundamental Packages for Swift

License

  • MIT